package com.ruoyi.project.knowledge.damage.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.knowledge.damage.mapper.KnowledgeFractureDamageInfoMapper;
import com.ruoyi.project.knowledge.damage.domain.KnowledgeFractureDamageInfo;
import com.ruoyi.project.knowledge.damage.service.IKnowledgeFractureDamageInfoService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 断裂损伤信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-04-27
 */
@Service
public class KnowledgeFractureDamageInfoServiceImpl implements IKnowledgeFractureDamageInfoService 
{
    @Autowired
    private KnowledgeFractureDamageInfoMapper knowledgeFractureDamageInfoMapper;

    /**
     * 查询断裂损伤信息
     * 
     * @param id 断裂损伤信息主键
     * @return 断裂损伤信息
     */
    @Override
    public KnowledgeFractureDamageInfo selectKnowledgeFractureDamageInfoById(Long id)
    {
        return knowledgeFractureDamageInfoMapper.selectKnowledgeFractureDamageInfoById(id);
    }

    /**
     * 查询断裂损伤信息列表
     * 
     * @param knowledgeFractureDamageInfo 断裂损伤信息
     * @return 断裂损伤信息
     */
    @Override
    public List<KnowledgeFractureDamageInfo> selectKnowledgeFractureDamageInfoList(KnowledgeFractureDamageInfo knowledgeFractureDamageInfo)
    {
        return knowledgeFractureDamageInfoMapper.selectKnowledgeFractureDamageInfoList(knowledgeFractureDamageInfo);
    }

    /**
     * 新增断裂损伤信息
     * 
     * @param knowledgeFractureDamageInfo 断裂损伤信息
     * @return 结果
     */
    @Override
    public int insertKnowledgeFractureDamageInfo(KnowledgeFractureDamageInfo knowledgeFractureDamageInfo)
    {
        knowledgeFractureDamageInfo.setCreateTime(DateUtils.getNowDate());
        return knowledgeFractureDamageInfoMapper.insertKnowledgeFractureDamageInfo(knowledgeFractureDamageInfo);
    }

    /**
     * 修改断裂损伤信息
     * 
     * @param knowledgeFractureDamageInfo 断裂损伤信息
     * @return 结果
     */
    @Override
    public int updateKnowledgeFractureDamageInfo(KnowledgeFractureDamageInfo knowledgeFractureDamageInfo)
    {
        return knowledgeFractureDamageInfoMapper.updateKnowledgeFractureDamageInfo(knowledgeFractureDamageInfo);
    }

    /**
     * 批量删除断裂损伤信息
     * 
     * @param ids 需要删除的断裂损伤信息主键
     * @return 结果
     */
    @Override
    public int deleteKnowledgeFractureDamageInfoByIds(String ids)
    {
        return knowledgeFractureDamageInfoMapper.deleteKnowledgeFractureDamageInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除断裂损伤信息信息
     * 
     * @param id 断裂损伤信息主键
     * @return 结果
     */
    @Override
    public int deleteKnowledgeFractureDamageInfoById(Long id)
    {
        return knowledgeFractureDamageInfoMapper.deleteKnowledgeFractureDamageInfoById(id);
    }
}
